﻿using Foothill.Common;
using Foothill.DataAccess.Interface;

namespace Foothill.DataAccess.Repository
{
    public class SystemMessageRepoStub : ISystemMessageRepo
    {
        public string GetSystemMessage(SystemMessageCategory category, string msgCode, int cultureId)
        {
            string result = "undefined sys message";

            CultureCode culture = (CultureCode)cultureId;

            if ( msgCode == SystemMessageCode.InvalidEmailAddress )
            {
                if (culture == CultureCode.EN_US)
                    result = "Invalid Email Address";
                else if (culture == CultureCode.ZH_CN)
                    result = "Email 地址格式错误";
            }
            else if ( msgCode == SystemMessageCode.InvalidMileageValue )
            {
                if (culture == CultureCode.EN_US)
                    result = "Invalid Mileage Value";
                else if (culture == CultureCode.ZH_CN)
                    result = "里程数错误";
            }
            else if (msgCode == SystemMessageCode.InvalidPriceValue )
            {
                if (culture == CultureCode.EN_US)
                    result = "Invalid Price Value";
                else if (culture == CultureCode.ZH_CN)
                    result = "价格输入有误";
            }
            else if (msgCode == SystemMessageCode.NoModelSelected)
            {
                if (culture == CultureCode.EN_US)
                    result = "Please select a model";
                else if (culture == CultureCode.ZH_CN)
                    result = "请选择车型";
            }
            else if (msgCode == SystemMessageCode.DescriptionTooLong)
            {
                if (culture == CultureCode.EN_US)
                    result = "description too long";
                else if (culture == CultureCode.ZH_CN)
                    result = "请小于"+GlobalSettings.AdDescriptionMaxNumOfChars+"字";
            }
            else if (msgCode == SystemMessageCode.AtLeastOnePhoto)
            {
                if (culture == CultureCode.EN_US)
                    result = "At least one photo is needed";
                else if (culture == CultureCode.ZH_CN)
                    result = "请上传至少一张照片";
            }
            else
            {
                result = "Message for code: " + msgCode + " in culture:" + cultureId;
            }

            return result;
        }
    }
}
